package com.wyf.service;

import com.wyf.dao.UserDao;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

@Service
public class UserService {
    @Resource
    private UserDao userDao;

    @Value("${jdbc.driver}")
    private String driver;
    @Value("${jdbc.url}")
    private String url;
    @Value("${jdbc.username}")
    private String userName;
    @Value("${jdbc.password}")
    private String password;

    // 控制台打印属性信息
    public void showConfigInfo() {
        System.out.println("driver:" + driver + "\nurl:" + url);
        System.out.println("userName:" + userName + "\npassword:" + password);
    }

    public void test() {
        System.out.println("UserService.test...");
        userDao.test();
    }
}
